﻿using System;
using System.Collections.Generic;
using System.Data.Entity.ModelConfiguration;
using System.Linq;
using System.Text;
using WebPic.Sample.Modelo.Entidades;

namespace WebPic.Sample.Modelo.Mappings
{
   
    internal class MappingCliente : EntityTypeConfiguration<Cliente>
    {
       public MappingCliente()
       {
           HasOptional(tb => tb.TabelaPreco)
               .WithMany(c => c.Clientes)
               .HasForeignKey(t => t.IdTabelaPreco);


           HasOptional(r => r.Representante)
               .WithMany(c => c.Clientes)
               .HasForeignKey(r => r.IdRepresentante);


           HasOptional(t => t.Transportadora)
               .WithMany(c => c.Clientes)
               .HasForeignKey(t => t.IdTransportadora);
       }

    }
}
